To add delay task to DSP side, we added the
following code segment in m4vdec_api.c:

At the beginning of decoder_pslice():

    //////////////////////////////////Add delay task
    srand(300);
    slice_no=overhead( rand()%200*1000 );
    //////////////////////////////////delay task end 

And the function overhead() is defined as:

//////////////////For delay task
int
overhead(uint32 count)
{
    uint32 volatile c = 0;
    uint32  i;
    for (i = 1; i < count; i++)
    {
        c++;
    }
    return c;
}
//////////////////For delay task
